//
//  LCMessageCenterShowMsgView.m
//  LendCash
//
//  Created by Mac mini on 2018/5/24.
//  Copyright © 2018年 zt. All rights reserved.
//

#import "LCMessageCenterShowMsgView.h"

@implementation LCMessageCenterShowMsgView

-(instancetype)initWithFrame:(CGRect)frame{
    if (self = [super initWithFrame:frame]) {
        self.backgroundColor = RGB(235, 235, 235, .8);
        _textView = [[UITextView alloc]initWithFrame:CGRectMake(frame.size.width/4-20,SafeAreaTopHeight+100, frame.size.width/2+40, 200)];
        _textView.editable = NO;
        _textView.layer.borderWidth = 1;
        _textView.layer.borderColor = PUBLIC_LINE_COLOR;
        [self addSubview:_textView];
        
        UIButton *button = [[UIButton alloc]initWithFrame:CGRectMake(_textView.center.x-20, CGRectGetMaxY(_textView.frame), 40, 40)];
        button.backgroundColor = [UIColor whiteColor];
//        [button setImage:[UIImage imageNamed:@"logo"] forState:UIControlStateNormal];
        [button setTitle:@"关闭" forState: UIControlStateNormal];
        button.titleLabel.font = MIDDLE_FONT;
        [button setTitleColor:[UIColor darkGrayColor] forState:UIControlStateNormal];
        button.layer.borderWidth = 1;
        button.layer.borderColor = PUBLIC_LINE_COLOR;
        button.layer.cornerRadius = 20;
        
        [button addTarget:self action:@selector(click) forControlEvents:UIControlEventTouchUpInside];
        [self addSubview:button];
    }
    return self;
}

-(void)click{
    if (self.delegate && [self.delegate respondsToSelector:@selector(hiddenMsgButtonClick)]) {
        [self.delegate hiddenMsgButtonClick];
    }
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
